import Vue from "vue";
// 屏蔽浏览器间的样式差异
import "normalize.css/normalize.css"; // A modern alternative to CSS resets
// Element 相关配置
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import locale from "element-ui/lib/locale/lang/zh-CN"; // lang i18n
// 导入样式文件
import "@/styles/index.scss"; // global css

import App from "./App";
import store from "./store";
import router from "./router";
// 导入图标
import "@/icons"; // icon
// 权限控制
import "@/permission"; // permission control
// view UI ===============================
import ViewUI from 'view-design';
import 'view-design/dist/styles/iview.css';

Vue.use(ViewUI);

/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online ! ! !
 */
// 模拟后端接口
if (process.env.NODE_ENV === "production") {
  const { mockXHR } = require("../mock");
  mockXHR();
}

// set ElementUI lang to EN
Vue.use(ElementUI, { locale });
// 如果想要中文版 element-ui，按如下方式声明
// Vue.use(ElementUI)

Vue.config.productionTip = false;

new Vue({
  el: "#app",
  router,
  store,
  // 把APP组件渲染到index.html的类名为#app的标签中
  render: (h) => h(App),
});
